package com.homework;

import java.util.Objects;

/**
 * 描述: TODO
 *
 * @author CodeYang
 * @version 2020/12/17 9:38
 */
public class SeafoodPizza extends Pizza {
    /**
     * 配料
     */
    private String Ingredients;
    public SeafoodPizza() {
    }

    public SeafoodPizza(String ingredients) {
        Ingredients = ingredients;
    }

    public SeafoodPizza(String name, double price, double size, String ingredients) {
        super(name, price, size);
        Ingredients = ingredients;
    }

    public String getIngredients() {
        return Ingredients;
    }

    public void setIngredients(String ingredients) {
        Ingredients = ingredients;
    }

    @Override
    public void show() {
        super.show();
        System.out.println("配料信息:"+this.Ingredients);
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        if (!super.equals(o)) return false;
        SeafoodPizza that = (SeafoodPizza) o;
        return Ingredients.equals(that.Ingredients);
    }

    @Override
    public int hashCode() {
        return Objects.hash(super.hashCode(), Ingredients);
    }
}
